---------------Mega-Edit 3 1.0 FINAL Readme---------------
Coded By Ben Goodrich (aka Benjamin)

-Note, just because it says final doesn't mean there is no
chance I'll update it again. I might someday. But I doubt it.
However,I will definatly update it if a bug is found.
So please report bugs to goodrich1@msn.com .

-Disclaimer-

DISCLAIMER:I take no responsibilities for any damages
this program may cause to your computer, your dog, your sanity,
or anything else. In other words you use it at your own risk.

-Introduction-

Do you remember playing through Megaman 3?
I, the coder of this editor certainly do.
I have fond memories of my friend coming over
when I was 8, and playing it with me.

Now through emulation I can relieve those memories.
It's great, and what's greater is being able to hack
the levels.

This Editor was the result of about 5 long days of work.
(yes I did it that fast!) But it's still very incomplete.
So far there isn't any sprite support yet but that is coming
soon, very soon, maybe in a few days. But I really want to
get this out to everyone. So I've made a release.

-Why?-
Actually there are several reasons why I created this editor, and
it's purpose. I'll just list them all.

1. Boredom. Yes I was bored and looking for something to do.

2. I wanted to see if I could do it, and so far it's been a success.

3. To encourage people to make levels for this great game.

Please use my editor and make some levels.
I would like to see what others can pull off with this
utility, and I'll be glad to play them too!

-Purpose-

This editor (even without sprite support) can be very powerful
tool. It can also be quite confusing for someone beside myself
to use. I created it, and I know all about how to use it. But someone
else has to figure it all out.

The purpose of this readme is to explain how to use it.
However, aside from having to memorize the keys,
it isn't very hard to do some basic structure editing.

If you want to just skip this and figure some of it
out yourself then feel free to do so. But you still should
look at this sooner or later especially if you want to learn
about sprite and scroll editing.

-Terminology-
To avoid confusion I will set all the terms straight.
So you will understand what I am saying when I refer to a
block, a tile, or a structure.

Pattern Table - This refers to that table of 8x8 patterns in the
                upper left corner of the editor.

Tile or Pattern - This is one 8x8 pattern from the Pattern Table.

Block - This is a 16x16 block; it is made up of 4 8x8 Tiles, each tile
        has its own properties, and palette.

Structure - This is a 32x32 thingamabob; it's made up of 4 16x16 blocks,
            and its the heart of what makes up the maps.

Map - This is a map; it's 64 bytes big, and made up of 64 32x32 structures.
      It is 8 structures wide, and 8 structures tall. Each level is made up
      of a set of these.

Sprite - This is an enemy or something that moves.

-Keys-
KEYS:
SHIFT - Holding this allows sort of an auto click feature. It can be useful instead
of having to click over and over.

INSERT - Holding this while clicking on the map inserts a sprite

DELETE - Hitting this will delete the currently selected sprite

P - Change the offset from which the palette is taken (different parts of levels
sometimes use different palettes)

Q and W - Cycle LEFT and RIGHT through the palette that is shown for the pattern tables.

A and S - Cycle Left and Right through the structures.

Z and X - Cycle Left and Right through the blocks.

E and R - Cycle through different data offsets, or levels.

D and F - Cycle through different CHR offsets, the editor will automatically attempt
to choose the correct one, but incase it's wrong or something use these keys.

1, 2, 3, 4, 5, 6, 7, 8, 9 - Change different sprite stuff... Figure it out yourself
I'm too lazy to list them all.

Left and Right arrow keys - Cycle through the maps.

F2 - Save PCX snapshot as snapshot.pcx

F4 - Reload the ROM, in case you goof up or do something stupid.

And most importantly:

F5 - Save Changes, DO NOT FORGET THIS KEY! It saves your work into the ROM.
     I myself have worked on several screens only to hit escape and exit without
     saving. Do NOT make that mistake, be SURE to hit this before exiting.

-How to use-

Well,
Below is sort of a dummy guide.
-1 Editing Blocks-

Blocks are the basic building blocks of the level.
Each one has 4 pattern tables that make it up, some properties,
and it's palette.

To select a block hit A or S, or just click onto a block outside of
that red rectangle.

To edit what patterns make up a block, select a pattern from the
pattern table (the pattern tables are in the far upper left corner
of the editor screen), and then click inside the currently selected
block which should have a red rectangle around it, to draw the
pattern there.

To edit a block's palette, look to the right of the block list and you should
see something that says "Blockpal = [0x??]" click inside that box to change the
number, and the palette.

To edit the properties just click inside that box where it says "Blockdata"
I'm not sure right off what all the properties are. I just know that 1 means
solid, and 0 means empty. You will have to figure the rest out yourself.
Or wait for a later version of the readme.

-2 editing structures-
Structures are the basic building blocks of a map; use them wisely!

To select a structure hit A or S, or click onto a structure outside of
that red rectangle.

To edit what blocks make up a Structure, select a block from the list
and click onto part of the structure inside that red rectangle.
It should put the block there.

Don't forget to create new structures when you need them!

-3 editing maps-
To select a map, click on the maps to the left and right of one with
a red rectangle around it. It should select them.

To draw a structure on a map, just select a structure from the list of
Structures, and click onto part of the map with a red rectangle around
it. It should draw a structure wherever you clicked.

In the ROM, there is a list of map screens for the game to display.

You can edit this list by clicking on the < and >, where it says
"< MAP SCREEN >", the changes will show up immediately.

WARNING: Even though the editor supports values greater than 31 for the
map screen. It should NOT be edited. Because map data beyond that isn't
actually map data. It is other data. The editor will display "MAP SCREEN"
in red if it is greater than 31.

-4 Palette editing-
Well now this is pretty simple, you will see a table of colors and numbers
on the right side of the editor screen. Just click on some of them and changes
should show up immediately.

The numbers represent the hex value of the NES colors.

Each row of colors represents a different palette. Hit P to cycle through the
palettes if you want to see them on the map.

-5 Editing Sprites-
Sprite editing is a very awkward part of the editor. I tried to make it
as easy as possible. But because the way the data is stored I don't know
what else to do to make it any easier.

I suggest you read this completely before trying to use the sprite editing
feature.

To use it, first, hit space to show the sprites.
You should see a bunch of numbers on various parts of the screen.
These numbers represent the type of sprite, their position shows
the position for that sprite.

Now what you want to do is edit them.

To select a sprite to edit change CURRENT SPRITE to the one you want.
There are two ways to edit its position, either you can click around on the
map, or you can manually edit its position by changing SPRITE X, SPRITE Y, and
SPRITE SCREEN.

If you do it by clicking on the map, be sure you hit space to enable sprite mode

The sprite table should follow some kind of order or else the game won't run
properly, what I mean is you should NOT put a sprite one screen ahead of the
one before it. Like sprite 1 can't be on screen 2, and sprite 2 be on screen 1
If something like this occurs the editor will display the messed up sprite in
green.

To edit the sprite type, just change the SPRITE TYPE to whatever you want it to be.
But be warned putting the wrong sprites in the wrong levels or even the wrong parts
of a level can make their graphics be glitched. To fix this you must learn to use
SCREEN CHR DATA on the most advanced feature - scroll editing.

To insert a sprite hold the INSERT key and click, a sprite should be inserted.
To delete a sprite, select the sprite you want deleted and hit the DELETE key.

-6 The killer, scroll editing-
WARNING: This is a highly advanced feature and should not be used unless you
read and understand this, and have a backup of the original. Not doing so can
severely mess up the ROM.

Originally I wasn't even gonna add this, but I decided to. Just to make the
editor complete.

COMMAND basically tells the offset from which the other data is read; changing it
can do no harm.

The SCREEN DIRECTION has 2 hex numbers, and here is what they mean:
The first number tells the direction, and the second number tells how many times to
repeat that direction.
Known directions are:
2 RIGHT
4 DOWN
6 DOWN RIGHT
8 UP
A UP RIGHT
There's probably more that I have left out.

The SCREEN PALLETE tells which palette to use for this command; this is the same kind of
palette you switch to when you hit P. You can select from 4 palettes. The good thing
about this is that some levels have an unused palette, which you can tap into by changing
colors on the palette editor and then switching to it on some of the screens by using this.

The SCREEN CHR DATA tells where the chr data (graphics) for the sprites are loaded from.
By changing this you can put sprites from other levels or other screens of the same level
into your level or screen.

To do that you must go to the other level and/or command and check the value of
it's SCREEN CHR DATA then go to your level and change this to the other number.
You will then be able to put sprite types from that level into your level.


-7 a small tutorial for the scroll editing-

If you didn't understand any of that, then I'll use Needle Man's Stage as an
example. With this tutorial when the editor first starts up, you see
Needle Man's level SCREEN DIRECTION should say 22. This means that you go in
direction 2 for the first 2 screens.

Now go to the next command by changing COMMAND to 1, SCREEN DIRECTION will
change to 66. If you look on the char above you will see that 6 means DOWN RIGHT. So
this is saying go DOWN RIGHT for 6 screens.

You can look on the map and see that after the first 2 screens there is a ladder that
takes you down, then you go right for 6 screens.

Now put COMMAND back to 0.

If you look at the SCREEN PALLETE for this it should be 0, which means to use palette 0.
If you change this to 1 then you will use palette 1, which would make
the game look the same as if you had hit P in the map editor and made curpal be 1.

If you look at SCREEN CHR DATA, it should say 2e
2e is the magic number for this chr data. If you want to use those needle
armadillo things in another stage you must set the SCREEN CHR DATA for that stage to 2e.


-8 data formats-
The way the data is stored is pretty simple. I'll try and explain here.

Here are some offsets in the megaman3.nes file. These are all in hex.

This is for Needle Mans stage.
Add multiples of 0x2000 to these offsets to get to data for other stages.
for example, if A10 tells the screen layout for Needle Mans stage
then 2a10 will tell the screen layout for the next stage.

A10-A4F tells the layout of the screens that make up the level. Usually it reads
like 01,02, 03, 04, 05 ect... it lists all the screens

A50-A6F lists what my editor calls SCREEN DIRECTION, telling which way you can go
on each screen.

A70-A8F is ordered in 2 byte pairs, the first byte tells SCREEN CHR DATA,
and the second tells SCREEN PALLETE. For example, 
A70 tells the CHR DATA for COMMAND 0.
A71 tells the PALLETE for COMMAND 0.
A72 tells the CHR DATA for COMMAND 1.
A73 tells the PALLETE for COMMAND 1.
Etc.

A90-A92 is a pointer that tells what block chr data to load for the whole level.
I don't know how the pointer works but it works somehow.

A92-??? has the palette for the level.

B10-C0F lists all the screens for the sprites. It goes in order from sprite 0 to sprite 255.

C10-D0F lists all the x positions of the sprites, in order from sprite 0 to sprite 255.

D10-E0F lists all the y positions of the sprites, in order from sprite 0 to sprite 255.

E10-F0F lists all the sprite types, in order from sprite 0 to sprite 255.

F10-1710 actually lists all the structures for all 32 screens.
It works like this, F10-F4F lists them for the first screen.
Then the next 64 (not hex) bytes list them for the next screen.
A screen is 8x8 structures big. 8x8 = 64 so 64 is how many bytes
each screen is.

1710-1B0F tells what blocks make up the structures. 4 bytes represent 1 structure.
They point to one of 255 blocks.

1B10-1F0F lists what pattern makes up the blocks. It's formatted weirdly like this:
Tile 1 of block 0 is at 1B10
Tile 2 of block 0 is at 1C10
Tile 3 of block 0 is at 1D10
Tile 4 of block 0 is at 1E10
Tile 1 of block 1 is at 1B11
Tile 2 of block 1 is at 1C11
Tile 3 of block 1 is at 1D11
Tile 4 of block 1 is at 1E11
ect, you can figure it out from there.

1F10-200F lists all the block properties; it goes from block 0 to block 255.

-Conclusion-

Well that's it, there are probably a few things left out of this readme
if so just let me know and I'll try and fix it.

So what are you waiting for? Go make some Megaman 3 levels.
